package com.leal.util

import org.yaml.snakeyaml.Yaml

import java.util

/**
 * @title: YamlUtil
 * @projectName bigdata
 * @description: YamlUtil
 * @author leali
 * @date 2022/4/12 20:53
 */
object YamlUtil {
  def getEnvInfo(mode: String, configName: String = "config.yaml"): util.LinkedHashMap[String, String] = {
    new Yaml().load(
      getClass.getResourceAsStream(s"/$configName")
    ).asInstanceOf[util.LinkedHashMap[String, util.LinkedHashMap[String, String]]].get(mode)
  }
}
